package cn.bandeqing.shortMessage.controller;

import cn.bandeqing.base.resp.Resp;
import cn.bandeqing.base.resp.Table;
import cn.bandeqing.shortMessage.req.ShortMessageTableReq;
import cn.bandeqing.shortMessage.resp.ShortMessageTable;
import cn.bandeqing.shortMessage.rpc.IShortMessageRpc;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/shortMessage")
@RestController
@Tag(name = "短信")
public class ShortMessageController {

    @DubboReference
    private IShortMessageRpc shortMessageRpc;

    @Operation(summary = "表格")
    @PostMapping("/table")
    public Resp<Table<ShortMessageTable>> table(@RequestBody @Valid ShortMessageTableReq req) {
        return shortMessageRpc.table(req);
    }

}
